<%@ Page Language="C#" Theme="Defaultsys" AutoEventWireup="true" CodeFile="RoleList.aspx.cs"
    Inherits="RoleList" Title="Rapport Plan System - Role list" MasterPageFile="~/MasterPage.master" %>

<%@ MasterType VirtualPath="~/MasterPage.master" %>
<asp:Content runat="server" ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1">
    <table border="0" width="100%" cellpadding="0" cellspacing="0">
        <tr>
            <td class="contTable">
                <asp:GridView ID="gvRoles" runat="server" DataKeyNames="RoleId" AutoGenerateColumns="False"
                    CellPadding="0" CellSpacing="0" Width="100%" SkinID="gvGrid" AllowPaging="True"
                    AllowSorting="True" OnRowCommand="gvRoles_RowCommand" OnRowDataBound="RowDataBound"
                    OnPageIndexChanging="gvRoles_PageIndexChanging">
                    <Columns>
                        <asp:TemplateField HeaderText="ID" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"
                         HeaderStyle-Width="3%">
                            <ItemTemplate>
                                <%# Container.DataItemIndex + 1 %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        
                        <asp:BoundField DataField="Name" HeaderText="Role Name">
                            <ItemStyle HorizontalAlign="Left" />
                            <HeaderStyle HorizontalAlign="Left" />
                        </asp:BoundField>
                        
                        <asp:TemplateField HeaderText="Edit" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <asp:Button ID="btnEdit" runat="server" CommandName="edit" Text="Edit" CommandArgument='<%# Eval("RoleId") %>' />
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" Width="5%" />
                        </asp:TemplateField>
                        
                        <asp:TemplateField HeaderText="Delete" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <asp:Button ID="btnDel" runat="server" CommandName="delete" Text="Delete" CommandArgument='<%# Eval("RoleId") %>' />
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" Width="5%" />
                        </asp:TemplateField>
                    </Columns>
                    <HeaderStyle CssClass="grid_header" />
                    <RowStyle CssClass="grid_row" />
                    <AlternatingRowStyle CssClass="grid_altrow" />
                    <EmptyDataTemplate>
                        There are currently no groups.</EmptyDataTemplate>
                    <PagerStyle VerticalAlign="Middle" HorizontalAlign="Left" Wrap="False" CssClass="paging"
                        Font-Bold="True"></PagerStyle>
                    <PagerSettings Mode="NumericFirstLast" />
                </asp:GridView>
                <br />
                <asp:Button ID="btnAddNewUser" runat="server" OnClick="AddNewUser" Text="Add new user group" />
            </td>
        </tr>
    </table>
</asp:Content>
